echo "Download dataset"
wget https://dax-cdn.cdn.appdomain.cloud/dax-pubtabnet/2.0.0/pubtabnet.tar.gz
echo "Download pretrain model"
wget https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/en_ppstructure_mobile_v2.0_SLANet_train.tar
echo "Unzip dataset"
tar -zxvf pubtabnet.tar.gz
echo "Unzip pretrain model"
tar -xvf en_ppstructure_mobile_v2.0_SLANet_train.tar
echo "Unzip PaddleOCR"
unzip PaddleOCR-release-2.7.zip
echo "Rename folder"
mv PaddleOCR-release-2.7 PaddleOCR27
echo "Prepare dataset"
python prepare_data.py
echo "Install PaddleOCR"
pip install -r PaddleOCR27/requirements.txt
echo "Copy files"
cp -f table_att_head.py PaddleOCR27/ppocr/modeling/heads/
cp infer_table1.py PaddleOCR27/tools/